<template>
	<div class="enterpriseOne">
		<!-- 企业详情头部 -->
		<oneHeader :baseData="baseData"></oneHeader>
		<!-- 企业详情导航 -->
		<div class="enterpriseOne_navlist">
			<div class="enOne_navitem" :class="navOneNum===0 ? 'active' : ''" @click="toNavOne(0)">
				<img v-if="navOneNum==0" src="../../../public/images/enterprise/xinxi-on.png" class="xinxi" alt="">
				<img v-else src="../../../public/images/enterprise/xinxi-on.png" class="xinxi" alt="">
				<div class="navitemname" :class="navOneNum===0 ? 'active' : ''">
					基本信息
				</div>
			</div>
			<div class="enOne_navitem" :class="navOneNum===1 ? 'active' : ''" @click="toNavOne(1)">
				<img v-if="navOneNum==1" src="../../../public/images/enterprise/qiye-on.png" class="xinxi" alt="">
				<img v-else src="../../../public/images/enterprise/qiye-on.png" class="xinxi" alt="">
				<div class="navitemname" :class="navOneNum===1 ? 'active' : ''">
					企业画像
				</div>
				
			</div>
			<div class="enOne_navitem" :class="navOneNum===2 ? 'active' : ''" @click="toNavOne(2)">
				<img v-if="navOneNum==2" src="../../../public/images/enterprise/zhishi-on.png" class="xinxi" alt="">
				<img v-else src="../../../public/images/enterprise/zhishi-on.png" class="xinxi" alt="">
				<div class="navitemname" :class="navOneNum===2 ? 'active' : ''">
					知识产权
				</div>
				
			</div>
			<div class="enOne_navitem" :class="navOneNum===3 ? 'active' : ''" @click="toNavOne(3)">
				<img v-if="navOneNum==3" src="../../../public/images/enterprise/rongzi-on.png" class="xinxi" alt="">
				<img v-else src="../../../public/images/enterprise/rongzi-on.png" class="xinxi" alt="">
				<div class="navitemname" :class="navOneNum===3 ? 'active' : ''">
					融资历程
				</div>
				
			</div>
		</div>
		<!-- 企业详情导航对应页面 -->
		<div class="enterpriseOne_content">
			<!-- 基本信息页面 -->
			<basicInformation :bcompany="bCompany" v-if="navOneNum===0"  ></basicInformation>
			<!-- 企业画像页面 -->
			<enterpriseImage v-if="navOneNum===1"></enterpriseImage>
			<!-- 知识产权页面 -->
			<iProperty v-if="navOneNum===2" :propTite="iPropertyName"></iProperty>
			<!-- 融资历程页面 -->
			<financeCourse v-if="navOneNum===3"></financeCourse>
		</div>
	</div>
</template>

<script>
	import oneHeader from '../../components/enterprise1/oneHeader.vue'
	import basicInformation from '../../components/enterprise1/basicInformation.vue'
	import enterpriseImage from '../../components/enterprise/enterpriseImage.vue'
	import iProperty from '../../components/enterprise1/iProperty.vue'
	import financeCourse from '../../components/enterprise1/financeCourse.vue'
	import  {SM4}  from 'gm-crypto'
	export default{
		name:'enterpriseOne',
		data() {
			return{
				navOneNum:0,
				baseData:{},
				bCompany:'',
				iPropertyName:''
			}
		},
		mounted() {
			this.getBasedata()
		},
		methods:{
			// 获取企业详情头部信息
			async getBasedata(){
				this.bCompany=this.$route.query.cid
				var dt = {
					"randomNum": '0123456789abcdeffedcba9876543210',
    			"id": this.bCompany
				};
				const aaa = await this.$api.post('/api/v1/cockpit/cockpitInterface?methodname=getCompanyById', dt)
				const bbb = SM4.decrypt(aaa.data, '0123456789abcdeffedcba9876543210', {
					inputEncoding: 'base64',
					outputEncoding: 'utf8'
				})
				this.baseData = JSON.parse(bbb)
				this.iPropertyName =this.baseData.qymc
				console.log(this.baseData)
			},
			// 导航切换
			toNavOne(e){
				this.navOneNum=e
			}
		},
		components:{
			oneHeader,
			basicInformation,
			enterpriseImage,
			iProperty,
			financeCourse
		}
	}
</script>

<style lang="stylus" rel='stylesheet/stylus' scoped>
	@import "~@/assets/enterpriseOne.styl"
</style>
